#pragma once
#include"Box2D/Dynamics/b2ContactManager.h"
#include"Box2D/Dynamics/Contacts/b2Contact.h"
#include"Box2D/Dynamics/b2WorldCallbacks.h"
#include<vector>

class Graviation;

class GrasviationListener: public b2ContactListener
{
public:
	friend class Graviation;

	GrasviationListener(Graviation* main);

	virtual void BeginContact(b2Contact* contact);
	virtual void EndContact(b2Contact* contact);
	virtual void PreSolve(b2Contact* contact, const b2Manifold* oldManifold);
	virtual void PostSolve(b2Contact* contact, const b2ContactImpulse* impulse);
private:
	std::vector<b2Body*> checkWithTarget(b2Body* checkA, b2Body* checkB, b2Body* targetA, b2Body* targetB);

	Graviation * app;
	bool isBirdSensor = false;
};

